use sha1::{Sha1, Digest};
use rustc_serialize::hex::ToHex;

pub fn encode(data:&str) -> String {
    Sha1::new()
    .chain_update(data.as_bytes())
    .finalize().to_vec().to_hex()  // hex_hash
}